package com.wondersgroup.fjzlpt.org.dao.impl.jgqy.fwgl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.alibaba.fastjson.JSONArray;
import com.quick.framework.boot.repository.sql.bean.SQLBean;
import com.quick.framework.boot.repository.sql.bean.table.TableBean;
import com.quick.framework.boot.repository.sql.jdbcTemplate.impl.BaseJTDAOImpl;
import com.wondersgroup.fjzlpt.org.dao.inter.jgqy.fwgl.TljlDAO;
@Repository
public class TljlDAOImpl extends BaseJTDAOImpl implements TljlDAO{
	@Override
	@Autowired
	@Qualifier("TB_JGQY_TLJL")
	public void setTb(TableBean tb) {
		super.setTb(tb);
	}

	@Override
	public JSONArray query(Map<String, String> map) {
		StringBuffer sbuf = new StringBuffer();
		sbuf.append("select a.*, ");
		sbuf.append("(select YLJGMC from TB_ZD_YLJGXX where PTJGID = a.YLJGID ) YLJGMC,");
		sbuf.append("(select XM from TB_ZD_YLJGRYXX where USERID = a.YSID ) YSXM ");
		sbuf.append(" from "+this.tb.getTableName()+" a where a.FWGLID = ? order by a.TLSJ ");
		SQLBean sb = new SQLBean(sbuf.toString(), new String[]{map.get("FWGLID")});
		return super.queryList(sb);
	}


}
